

import jgame.JGPoint;
import Units.UnitName;

public class Board {
	private int boardHeight = 15, boardWidth = 6;
	
	private JGPoint realCoordinates[][] = new JGPoint[boardHeight][boardWidth];
	private UnitName unitName[][] = new UnitName[boardHeight][boardWidth];
	
	// constructor
	Board(){
		for (int i = 0; i < boardHeight; i++){
			for (int j = 0; j < boardWidth; j++){
				unitName[i][j] = UnitName.EMPTY;
			}
		}
			
		unitName[0][0] = unitName[0][1] = unitName[1][0] = unitName[2][0] = 
			unitName[0][4] = unitName[0][5] = unitName[1][4] = unitName[2][5] = 
				unitName[12][0] = unitName[13][0] = unitName[14][0] = unitName[14][1] =
					unitName[14][4] = unitName[13][4] = unitName[12][5] = unitName[14][5] = UnitName.NULL;
		
		for (int i = 1; i < boardHeight; i += 2) unitName[i][5] = UnitName.NULL;
	}
	
	// methods
	public JGPoint getRealCoordinates(int i, int j){
		return new JGPoint(i, j);
	}

	public UnitName getUnitName(int i, int j){
		return unitName[i][j];
	}
	
	public boolean inBoard(int i, int j){
		if (i < 0 || j < 0 || i > 14 || j > 5) return false;
		return unitName[i][j] != UnitName.NULL;
	}
}
